updating oE frac

frac

include math.e 
namespace math 
public function frac(object x) 

returns the fractional portion of a number.

Parameters:
  1. value : any Euphoria object.
Returns:

An object, the shape of which depends on values's. Each item in the returned object will be the same corresponding items in value except with the integer portion removed.

Comments:

Note that trunc(x) + frac(x) = x

Example 1:
a = frac(9.4) 
-- a is 0.4 
Example 2:
s = frac({81, -3.5, -9.999, 5.5}) 
-- s is {0, -0.5, -0.999, 0.5} 
See Also:

trunc

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu